package org.acme.oauth2.restclient;

import org.eclipse.microprofile.rest.client.annotation.RegisterClientHeaders;
import org.eclipse.microprofile.rest.client.inject.RegisterRestClient;
import org.jboss.resteasy.annotations.jaxrs.PathParam;

import javax.enterprise.context.ApplicationScoped;
import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;

/**
 * @author LiJian
 * @date 2021/6/8 11:02
 */
@Path("/oauth")
@RegisterRestClient
public interface RestClientService {
    @POST
    @Path("/token")
    @Produces(MediaType.APPLICATION_JSON)
    Response getToken(@QueryParam("client_id") String client_id,
                      @QueryParam("client_secret") String client_secret,
                      @QueryParam("username") String username,
                      @QueryParam("password") String password,
                      @QueryParam("grant_type") String grant_type
    );
}
